using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using trainstorm.InstanceClass;

namespace trainstorm.InstanceClass.Obstacles
{
	class Totem : Obstacle
	{
		private float velNaik;
		private float velTurun;
		private bool naik;
		public Totem(Game1 game, float posX, float posY) : base(game, 3, new Vector2(0), new Vector2(posX, posY))
		{
			velTurun = 1600;
			velNaik = 235;
			naik = false;
			scale = 0.5f;
		}
		public override void update(GameTime gameTime, float screenVel)
		{
			if (naik)
			{
				pos.X -= ((float)(gameTime.ElapsedGameTime.TotalSeconds) * (vel.X - screenVel));
				pos.Y += ((float)(gameTime.ElapsedGameTime.TotalSeconds) * -velNaik);
				if (pos.Y < 10f) naik = false;
			}
			else
			{
				//pos.X -= ((float)(gameTime.ElapsedGameTime.TotalSeconds) * (vel.X + screenVel));
				pos.Y += ((float)(gameTime.ElapsedGameTime.TotalSeconds) * velTurun);
				if (pos.Y + gambar.Height*scale > 370) naik = true;
			}
		}

	}
}
